package com.auth.department;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Expression;
import org.hibernate.criterion.Restrictions;
import com.langsotech.base.Page;
import com.langsotech.methods.db.DbMethods;
public class MyTAuthDepartmentLogic {
	public static java.util.List queryAll(String dbName, com.auth.TAuthDepartment obj, Page page){
		Session session = DbMethods.getSession(dbName);
		Criteria cri = session.createCriteria(obj.getClass());
		if(obj.getName() != null)
			cri.add( Restrictions.like("name", "%" + obj.getName() + "%") );
		return DbMethods.getResult(cri, page);
	}
}
